package com.xingying.travel.service;
import com.xingying.travel.dao.CommentDao;
import com.xingying.travel.pojo.Comment;
import com.xingying.travel.util.IdWorker;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


@Service
@Transactional
public class CommentService
{
    @Autowired
    private CommentDao commentDao;

    @Autowired
    private IdWorker idWorker;


    public void add(Comment comment)
    {

            comment.setId(idWorker.nextId()+"" );
           commentDao.saveAndFlush(comment);

    }
}
